/**
 * crawler-base
 *
 * outlook@China software studio
 * Copyright (c) 2008-2011. All Rights Reserved.
 * http://www.outlook.com
 */

package org.outlook.crawler.client.domain;

import java.io.Serializable;

import org.outlook.crawler.client.pojo.MethodType;
import org.outlook.crawler.client.pojo.SourceStatus;

/**
 * function:
 * 
 * @author watson email: watson.wu@hotmail.com
 * @date 2011-4-24
 */
public class Source implements Serializable, Cloneable {

	private static final long serialVersionUID = 1L;

	public static final String SOURCE_TYPE_GET_REPLACEMENT = "${keyword_search}";

	public static Integer MAX_RESULT_NUM = 999;

	private long pid;
	private String name;
	private String url;// index page
	private String api;// api of fetching information
	private MethodType type;
	private String paramKeyValue;
	private String cookies;
	private String charset;
	private long fequency;
	private boolean avoidRobot;
	private boolean followRedirect;
	private long updateCycle;
	private SourceStatus status;

	public Source() {
		super();
	}

	public Source(String url) {
		this();
		this.url = url;
	}

	private String domain;//domain, likes ***.com
	private String requestURL;//current fetcher fetch url

	public long getPid() {
		return pid;
	}

	public void setPid(long pid) {
		this.pid = pid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getApi() {
		return api;
	}

	public void setApi(String api) {
		this.api = api;
	}

	public MethodType getType() {
		return type;
	}

	public void setType(MethodType type) {
		this.type = type;
	}

	public String getParamKeyValue() {
		return paramKeyValue;
	}

	public void setParamKeyValue(String paramKeyValue) {
		this.paramKeyValue = paramKeyValue;
	}

	public String getCookies() {
		return cookies;
	}

	public void setCookies(String cookies) {
		this.cookies = cookies;
	}

	public String getCharset() {
		return charset;
	}

	public void setCharset(String charset) {
		this.charset = charset;
	}

	public long getFequency() {
		return fequency;
	}

	public void setFequency(long fequency) {
		this.fequency = fequency;
	}

	public boolean isAvoidRobot() {
		return avoidRobot;
	}

	public void setAvoidRobot(boolean avoidRobot) {
		this.avoidRobot = avoidRobot;
	}

	public boolean isFollowRedirect() {
		return followRedirect;
	}

	public void setFollowRedirect(boolean followRedirect) {
		this.followRedirect = followRedirect;
	}

	public long getUpdateCycle() {
		return updateCycle;
	}

	public void setUpdateCycle(long updateCycle) {
		this.updateCycle = updateCycle;
	}

	public SourceStatus getStatus() {
		return status;
	}

	public void setStatus(SourceStatus status) {
		this.status = status;
	}

	public String getDomain() {
		return domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	public String getRequestURL() {
		return requestURL;
	}

	public void setRequestURL(String requestURL) {
		this.requestURL = requestURL;
	}

}
